﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using XXX.Models.XXXEntities;
using XXX.Bo;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace XXX.api.Controllers
{


    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class ST_GetProductInController : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<ST_GetProductInController> _logger;
        public ST_GetProductInController(ILogger<ST_GetProductInController> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }
        [HttpGet]
        public Models.RetModel Get(string corg, string ccode, string cwhcode)
        {
            Models.RetModel ret = DBService.ST_GetProductIn(corg,ccode, cwhcode);

            return ret;
            //return ReturnStd.Success(jsonstr);
        }
    }
    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class ST_GetProductIn2Controller : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<ST_GetProductIn2Controller> _logger;
        public ST_GetProductIn2Controller(ILogger<ST_GetProductIn2Controller> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }
        [HttpGet]
        public Models.RetModel Get(string corg, string ccode, string cwhcode)
        {
            Models.RetModel ret = DBService.ST_GetProductIn2(corg, ccode, cwhcode);

            return ret;
            //return ReturnStd.Success(jsonstr);
        }
    }

    /// <summary>
    /// 审核产成品入库库单
    /// </summary>
    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class ST_VerifyMoInController : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<ST_VerifyMoInController> _logger;
        public ST_VerifyMoInController(ILogger<ST_VerifyMoInController> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }


        [HttpPost]
        public Models.RetModelbool Post(PuArrivalBarcode model)
        {

            Models.RetModelbool ret = WMSService.ST_VerifyMoIn(model);

            return ret;
            //return ReturnStd.Success(jsonstr);
        }

    }

    /// <summary>
    /// 生成产成品入库单
    /// </summary>
    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class ST_MoToRd10Controller : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<ST_MoToRd10Controller> _logger;
        public ST_MoToRd10Controller(ILogger<ST_MoToRd10Controller> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }


        [HttpPost]
        public Models.RetModelbool Post(ScanBarcodeMo model)
        {

            Models.RetModelbool ret = WMSService.MoToRd10(model);

            return ret;
            //return ReturnStd.Success(jsonstr);
        }

    }


     
   

}
